package com.lyk.coursearrange.dao;

import com.lyk.coursearrange.entity.OnlineCategory;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;

import com.lyk.coursearrange.entity.dto.OnlineCategoryDto;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author lequal
 * @since 2020-06-04
 */
@Mapper
public interface OnlineCategoryDao extends BaseMapper<OnlineCategory> {
    @Select("SELECT id,category_name FROM `tb_online_category` WHERE  parent_id !=0")
    List<OnlineCategoryDto> getcategorylist();
    @Select("SELECT id,category_name FROM `tb_online_category` WHERE  parent_id in(0)")
    List<OnlineCategoryDto> categorytwolist();
    @Select("SELECT category_name FROM `tb_online_category` WHERE  id = #{courseId}")
    String selectname(@Param("courseId") Long courseId);
}
